import bus from "@/bus";
import {
  renderButton
} from '@/util';
let data = {
  status: 'pass',
  totalItem: 0,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    realname: "",
    phoneNo: "",
    roleId: '',
    roleList: [],
    contractStatus:'',
    contractStatusList: [{ id: 0, name: "否" }, { id: 1, name: "是" }]
  },
  columns: [{
      title: '姓名',
      key: 'realname',
      align: 'left',
      minWidth: 150
    }, {
      title: '昵称',
      key: 'nickName',
      align: 'left',
      minWidth: 150
    }, {
      title: '登录账号',
      key: 'mobile',
      align: 'left',
      minWidth: 150
    }, {
      title: '品牌方',
      key: 'supplierName',
      align: 'left',
      minWidth: 200
    }, {
      title: '品牌',
      key: 'brandName',
      width: 350,
      align: 'left',
      minWidth: 200,
      render: (h, p) => {
        let temp = (p.row.salesmanContractBrandDTOS || []).map(it => it.brandName).join(',')
        return <div class="e1" title={temp}>{temp}</div>
      }
    },
    {
      title: '职能类型',
      key: 'roleName',
      align: 'left',
      minWidth: 200
    },
    {
      title: '创建时间',
      key: 'createDate',
      align: 'left',
      minWidth: 200
    },
    {
      title: '是否签约',
      key: 'contractStatus',
      align: 'left',
      minWidth: 100,
      render: (h,p)=>{
        if(p.row.contractStatus == '1'){
           return h('div','是')
        }else{
          return h('div','否')
        }
      }
    },
    {
      title: '操作',
      align: 'right',
      minWidth: 200,
      render: (h, params) => {
        let status = params.row.contractStatus
        return ( <div > {
            renderButton(h, { text: '编辑', type: 'primary' },
              () => { bus.$emit("onEdit", params.row.id)})
          } 
          {
            renderButton(h, { text: status===0 ? '签约' : '解约',
                type: status===0 ? 'success' : 'warning',
              },() => { bus.$emit(status===0 ? 'onAppoint' : 'onRelieveAppoint', params)})
          }</div>
        )
      }
    }
  ],
  data:[]
  

}
export default data;
